import  request  from "@/utils/request";

export const articleList=(params)=>{
    return request({
        url:'/v1_0/articles',
        params
    })
}


// 封装一个获取新闻详情的方法(文章页面)
export const articleInfo = (id) => {

    return request({
        url: `/v1_0/articles/${id}`,
    })
}

// 封装一个点赞接口
export const zan = (data) => {

    return request({
        url: `/v1_0/article/likings`,
        method: 'post',
        data
    })
}

//封装一个不点赞接口
export const unzan = (id) => {

    return request({
        url: `/v1_0/article/likings/` + id,
        method: 'delete',
    })
}

// --------------------------------------------------------
//封装一个点不喜欢接口
export const unlike = (data) => {

    return request({
        url: `/v1_0/article/dislikes`,
        method: 'post',
        data
    })
}

//封装一个不点不喜欢接口
export const cancelUnlike = (id) => {

    return request({
        url: `/v1_0/article/dislikes/` + id,
        method: 'delete',
    })
}